package home.db;

import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.Reader;

/**
 * Created by Administrator on 2015/12/9.
 */
public class BaseDAO {
    private static SqlMapClient client = null;

    public static SqlMapClient getClient() {
        if (client == null) {
            Reader config = null;
            try {
                config = new FileReader("F:\\IdeaProjects\\study\\webModule\\src\\SqlMapConfig.xml");
                client = SqlMapClientBuilder.buildSqlMapClient(config);
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }
        return client;
    }



}
